package com.demo.blog.controller;

import com.demo.blog.pojo.response.BlogDetailResponse;
import com.demo.blog.pojo.response.BlogInfoResponse;
import com.demo.blog.service.BlogService;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/blog")
public class BlogController {

    @Autowired
    private BlogService blogServicie;

    @RequestMapping("/getList")
    public List<BlogInfoResponse> getList() {
        return blogServicie.getList();
    }

    @RequestMapping("/getBlogDeatail")
    public BlogDetailResponse getBlogDeatail(@NotNull Integer blogId) {
        return blogServicie.getBlogDeatail(blogId);
    }
}
